<?php

use Illuminate\Routing\Router;

Admin::registerHelpersRoutes();

Route::group([
    'prefix' => config('admin.prefix'),
    'namespace' => "App\Admin\Controllers",
    'middleware' => ['web', 'admin'],
], function (Router $router) {
    $router->get('/', 'HomeController@index');
    $router->any('upload-image', 'FileController@uploadImage')->name('upload-image');
    $router->post('editor-del-image', 'FileController@delImage')->name('editor-del-image');
    $router->resource('ad-position', 'AdPositionController');
    $router->resource('ad-list', 'AdController');
    $router->get('editor-images', 'EditorImagesController@index');
    $router->any('api/ad-positions', 'AdPositionController@adPositions');
    $router->any('api/get-media', 'MediaController@getMedia')->name('admin.get-media');
    $router->resource('wx-user', 'WxUserController');
    $router->resource('news', 'NewsController');

    $router->any('new-collect', 'NewsController@collect');
    $router->any('news/collect-create', 'NewsController@collect_create');

    $router->resource('media', 'MediaController');
    $router->resource('news-category', 'NewsCategoryController');

    $router->resource('typeoption', 'TypeoptionController');
    $router->resource('threadtype', 'ThreadtypeController');
    $router->resource('group_type', 'GroupTypeController');
    $router->resource('group', 'GroupController');
    $router->resource('group_post', 'GroupPostController');
});
